import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import uView from "uview-ui"; //安装uView
import mPlugins from './plugins/plugins' //引入组件
import API from'./utils/js/API.js'
import axios from'axios'
import Vueaxios from'vue-axios'
import {get} from'@/http' //引入get请求
import {post} from'@/http' //引入post请求
// import store from '@/store';
import store from './vuex/store.js';

/* axios.defaults.adapter = function(config) {
	console.log('config',config)
	return new Promise((resolve, reject) => {
		var settle = require('axios/lib/core/settle');
		var buildURL = require('axios/lib/helpers/buildURL');
		uni.request({
			method: config.method.toUpperCase(),
			url: buildURL(config.url, config.params, config.paramsSerializer),
			header: config.headers,
			data: config.data,
			dataType: config.dataType,
			responseType: config.responseType,
			sslVerify: config.sslVerify,
			complete: function complete(response) {
				// console.log("执行完成：", response)
				response = {
					data: response.data,
					status: response.statusCode,
					errMsg: response.errMsg,
					header: response.header,
					config: config
				};
				settle(resolve, reject, response);
			}
		})
	})
 }*/
Vue.use(uView);
Vue.use(mPlugins);
Vue.prototype.$get=get   //挂载$get 到Vue
Vue.prototype.$post=post //挂载$post 到Vue
Vue.prototype.API=API	//挂载API 到Vue
// Vue.prototype.$store=store
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App,
	store     	//使用Vuex
})
export default app
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif